<?php
/**
 * Created by PhpStorm.
 * User: worry
 * Date: 2019/1/5
 * Time: 15:03
 */
use \yii\helpers\ArrayHelper;
/**
 * @var $info common\models\Information
 */
?>
    <style>
        .table{word-break: break-all}
    </style>
<a href="<?= \yii\helpers\Url::to(['/information'])?>">客户信息</a>
<table class="table table-hover table-bordered">
    <tr><td colspan="20">一、个人信息</td></tr>
    <tr>
        <th>姓名</th>
        <td><?= $info->name?></td>
        <th>身份证号码</th>
        <td><?= $info->id_no?></td>
        <th>实名手机号</th>
        <td><?= $info->mobile?></td>
        <th>婚姻状况</th>
        <td><?= $info->is_marry?></td>
    </tr>
    <tr>
        <th>(手机号)服务密码</th>
        <td><?= $info->mobile_pass?></td>
        <th>属相</th>
        <td><?= $info->animal_zodiac?></td>
        <th>学历</th>
        <td><?= $info->education_background?></td>
    </tr>
    <tr>
        <th>现住宅地址</th>
        <td colspan="20"><?= $info->home_address?></td>
    </tr>
    <tr>
        <th>公司全称</th>
        <td colspan="20"><?= $info->company_name?></td>
    </tr>
    <tr>
        <th>公司地址</th>
        <td colspan="20"><?= $info->company_address?></td>
    </tr>
    <tr>
        <th>公司电话</th>
        <td><?= $info->company_tel?></td>
        <th>入职时间</th>
        <td><?= $info->entry_time ? date('Y-m-d', $info->entry_time) : ''?></td>
    </tr>
    <tr><td colspan="20">二、资产信息</td></tr>
    <?php $credit = json_decode($info->credit_info, true);?>
    <?php foreach ($credit as $card):?>
    <tr><th>发卡行</th><td><?= ArrayHelper::getValue($card, 'bank')?></td><th>额度</th><td><?= ArrayHelper::getValue($card, 'limit')?></td></tr>
    <?php endforeach;?>
    <tr><th>信用卡账单邮箱</th><td><?= $info->credit_email?></td><th>密码</th><td><?= $info->credit_email_pass?></td></tr>
    <tr><th>芝麻分</th><td><?= $info->zhima_score?></td></tr>
    <tr><th>社保卡号</th><td><?= $info->social_security?></td><th>密码</th><td><?= $info->social_security_pass?></td></tr>
    <tr><th>公积金卡号</th><td><?= $info->provident_fund?></td><th>密码</th><td><?= $info->provident_fund_pass?></td></tr>
    <tr><th>QQ号</th><td><?= $info->qq?></td><th>微信号</th><td><?= $info->wechat?></td></tr>
    <tr><th colspan="20">三、联系人信息</th></tr>
    <tr><th>父母</th><td><?= $info->parents_name?></td><th>手机</th><td><?= $info->parents_mobile?></td></tr>
    <tr><th>配偶</th><td><?= $info->spouse_name?></td><th>手机</th><td><?= $info->spouse_mobile?></td></tr>
    <tr><th>朋友</th><td><?= $info->friend_name?></td><th>手机</th><td><?= $info->friend_mobile?></td></tr>
    <tr><th>同事</th><td><?= $info->colleague_name?></td><th>手机</th><td><?= $info->colleague_mobile?></td></tr>
    <tr><th colspan="20">四、收款信息</th></tr>
    <tr><th>银行名称</th><td><?= $info->bank_name?></td><th>银行卡号</th><td><?= $info->bank_no?></td></tr>
    <tr><th colspan="20">身份证信息</th></tr>
    <tr><td colspan="20">
            <p class="text text-info">正面</p>
            <?= $info->card_front ? '<img style="width:200px" src="/'.$info->card_front.'"><button class="btn btn-primary show-source">显示原图</button>':'无'?>
        </td></tr>
    <tr><td colspan="20">
            <p class="text text-info">反面</p>
            <?= $info->card_back ? '<img style="width:200px" src="/'.$info->card_back.'"><button class="btn btn-primary show-source">显示原图</button>':'无'?>
        </td></tr>
</table>
<?php $this->registerJs('
$(".show-source").click(function(){
    var img = $(this).siblings("img");
    if(img) {
        var url = $(img).attr("src");
        layer.open({
            type: 1,
            title: false,
            closeBtn: 1,
            shadeClose: true,
            area: [80 + \'%\', 80 + \'%\'], //宽高
            content: "<img src=" + url + " />"
        });
    }
    
});
');?>